/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.mobiubiq.directory.service.handlers;

import org.mobiubiq.directory.client.data.Service;

/**
 *
 * @author Marnix Renne
 */
public class SmsServiceHandler implements ServiceHandler {

    public String[] getSupportedProtocols() {
        return new String[]{"sms"};
    }

    public void execute(Service service) {
        //applicationContext.openUrl(service.getUrl());
        /*
        final String url = service.getUrl();

        final TextBox messageText = new TextBox("Send sms", "", 255, TextField.ANY);
        final Command send = new Command("Send", Command.ITEM, 1);
        messageText.addCommand(send);
        messageText.setCommandListener(
                new CommandListener() {
                    public void commandAction(Command command, Displayable displayable) {
                        if (!applicationContext.processCommand(command, displayable)) {
                            try {
                                MessageConnection messageConnection = (MessageConnection) Connector.open(url);
                                TextMessage message = (TextMessage) messageConnection.newMessage(MessageConnection.TEXT_MESSAGE);
                                message.setPayloadText(messageText.getString());
                                messageConnection.send(message);
                            } catch (IOException ex) {
                                applicationContext.show(new Alert("Error", ex.getMessage(), null, AlertType.ERROR));
                            }
                        }
                    }
                });
        applicationContext.addApplicationCommands(messageText);
        applicationContext.show(messageText);
        */
    }
}
